/**
  * @Author: songgh
  * @Date: 2021-09-20 14:41:08
  * @LastEditors: songgh
  * @LastEditTime: 2021-09-20 15:41:08
  * @Description: 外壳
  */
import { defineComponent } from 'vue';
import { useRouter } from 'vue-router'

export default defineComponent({
    name: "Shell",
    props: {
        title: String,
    },
    setup() {
        const router = useRouter();
        return {
            router
        }
    },
    render() {
        return (<div class="h-screen">
            <div class="shell-header relative px-3 py-3 bg-white shadow-sm">
                <van-icon name="arrow-left"
                    onClick={() => this.router.back()}
                    class="absolute h-full flex justify-center items-center top-0 font-semibold text-base"
                />
                <h1 class="page-title text-center font-semibold text-base">{this.$props.title}</h1>
            </div>
            <div class="shell-body overflow-y-scroll bg-gray-100" style="height: calc(100vh - 3rem);">
                {this.$slots.default?.()}
            </div>
        </div>)
    }
})